package com.ease.common.vo.editor;

import java.util.Properties;

import org.springframework.beans.propertyeditors.PropertiesEditor;
import org.springframework.util.StringUtils;

import com.ease.common.vo.Manifest;

/**
 * 
 * @author nathanleewei
 * 
 */
public class ManifestEditor<T extends Manifest> extends AbstractObjectEditor<T> {// extends PropertyEditorSupport {

	public void setValue(Object value) {
		if (null != value) {
			// value.getClass().isAssignableFrom(T);
			super.setValue(value);
		}
	}

	protected Properties setAsProperties(String text) {
		if (StringUtils.hasLength(text)) {
			text = StringUtils.replace(text, "\r\n ", "");
			PropertiesEditor propertiesEditor = new PropertiesEditor();
			propertiesEditor.setAsText(text);
			return (Properties) propertiesEditor.getValue();
		}
		return null;
	}

	public T editAsText(String text) {

		return null;
	}

}
